/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.addressBook.baseService;

import com.addressBook.bean.UserInfo;
import java.util.ArrayList;

/**
 *
 * @author Lam
 */
public class Update {

    public ArrayList updateBean(ArrayList<UserInfo> beans, UserInfo oldBean, UserInfo newBean) {
        for (int i = 0; i < beans.size(); i++) {
            UserInfo bean = beans.get(i);
            if (bean.equals(oldBean)) {
                beans.set(i, newBean);
            }
        }
        return beans;
    }
}
